package cn.iocoder.yudao.module.worker.enums.trend;

import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import java.util.Arrays;

@RequiredArgsConstructor
@Getter
public enum TrendTypeEnum implements IntArrayValuable {
    MEMBER(0, "会员"),
    CLERK(1, "店员"),
    ;

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TrendTypeEnum::getType).toArray();

    /**
     * 类型
     */
    private final Integer type;
    /**
     * 类型名
     */
    private final String name;

    @Override
    public int[] array() {
        return ARRAYS;
    }

    public static boolean isMember(Integer type) {
        return ObjectUtil.equal(type, MEMBER.getType());
    }

    public static boolean isClerk(Integer type) {
        return ObjectUtil.equal(type, CLERK.getType());
    }
}
